/*
 * @Author: hutong huareu980@163.com
 * @Date: 2023-05-22 13:50:00
 * @LastEditors: hutong huareu980@163.com
 * @LastEditTime: 2023-06-10 21:16:41
 * @FilePath: /smart-web-app/nuxt.config.ts
 * @Description:
 */
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  css: ["~/assets/main.css"],
  modules: ["nuxt-swiper", "@nuxtjs/i18n", "@element-plus/nuxt"],
  i18n: {
    vueI18n: "./i18n.config.ts",
    strategy: "prefix_except_default",
    defaultLocale: "zh",
    customRoutes: "config",
    pages: {
      // "about/[id]": {
      //   en: "/about/[id]",
      // },
    },
    locales: [
      {
        code: "zh",
        iso: "zh-CN",
        name: "中文",
      },
      {
        code: "en",
        iso: "en-US",
        name: "English",
      },
    ],
    detectBrowserLanguage: {
      useCookie: true,
      cookieKey: "i18n_redirected",
      redirectOn: "root", // recommended
      alwaysRedirect: true,
    },
  },
  vite: {
    css: {
      preprocessorOptions: {
        scss: {
          additionalData: '@use "@/assets/_main.scss" as *;',
        },
      },
    },
    // resolve: {
    //   alias: {
    //     "vue-i18n": "vue-i18n/dist/vue-i18n.cjs.js",
    //   },
    // },
  },
});
